<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
	
<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">
		<form>
		 	    <fieldset>
		        <div style="margin:0; padding:1px 5px 5px;">
		    <!--    <span style="font-size:15px;font-weight: 500;">锁编号：</span> &nbsp
		            <input type="text"  name="stor_record_nickname" class="form-control" size="10" style="height:20px;width:120px ">        
		            &nbsp;  -->
		       <span style="font-size:15px;font-weight: 500;">入库员：</span> &nbsp;		          
		            <input type="text"  name="stor_record_name" class="form-control" size="10" style="height:20px;width:120px ">&nbsp;
		          <span style="font-size:15px;font-weight: 500;">时间查询：</span> &nbsp;		
				 <select id="stor_record_sto_select_day"  style="height:20px; font-size: 12px; width: 70px">
					         <option value="3" style="height:20px; font-size:12px">三天内</option>
					         <option value="7" style="height:20px; font-size:12px">一周内</option>
					         <option value="15" style="height:20px; font-size:12px">半月内</option>
					         <option value="30" style="height:20px; font-size:12px">一月内</option>
					         <option value="0" selected=""  style="height:20px; font-size:12px">全部</option>
					      </select>
		            <div class="btn-group">
		                <button type="button" onClick='stor_record_searchdata()' class="btn-green" data-icon="search" style="height:20px; font-size:12px">开始搜索！<tton>
		                <button type="reset" class="btn-orange" data-icon="times" style="height:20px; font-size:12px">重置<tton>
		            </div>
		        </div>
		    </fieldset>
		</form>
	</div>
	<div class="bjui-pageContent">
	<!-- <table class="table table-bordered" id="datagrid_id">
	
	</table> -->
		<table class="table table-bordered" id="sto_stor_record_id" data-toggle="datagrid"  data-options="{
		height: '100%',
		showToolbar: true,//显示工具栏
	<!-- 	toolbarItem: 'add,edit,del,|,import,export,exportf',//定义工具内容 -->
			toolbarItem: '|,export,exportf',//定义工具内容
		gridTitle : '入库记录',//表格名称
		filterThead: false,
		dataUrl: 'searchLockEnter',//表格数据源
	    dataType: 'json',//数据类型
        local:'remote',//分页显示
        paging:{pageSize:30,pageCurrent:1},
        editMode: {dialog:{width:'800',height:500,title:'编辑用户信息',mask:true}},//修改数据对话框的信息
        editUrl: '${pageContext.request.contextPath}/edit',//修改对话框的地址
        delUrl:'${pageContext.request.contextPath}/delete',//删除请求地址
        
        showCheckboxcol: true,//显示多选框
        linenumberAll: true//显示编号值
        
		}">
    <thead>
        <tr>
            <th data-options="{name:'username',align:'center',width:90}">入库人员</th>
			<th data-options="{name:'hInfo',align:'center',width:90}">硬件信息</th>
			<th data-options="{name:'locType',align:'center',width:90}">型号</th>
			<th data-options="{name:'eNum',align:'center',width:90}">入库数量</th>
			<th data-options="{name:'eDate',align:'center',width:250,render:'get_date'}">入库时间</th>
			 
        </tr>
    </thead>
      </table>   
	</div>
	
	<script type="text/javascript">

//搜索思路：   先用ajax方法传入数据库要搜索的内容，成功回调应有的参数，然后再相应的输出到datagrid框架中


	
	

function stor_record_searchdata(){
	var a  = $('#stor_record_sto_select_day').val();
/* 	var username = $("[name='stor_record_username']").val(); */
	var name = $("[name='stor_record_name']").val();
	if(a!=0)
		{
		 start = get_newdate(-1);
		 end = get_newdate(a);
		 $('#sto_stor_record_id').datagrid('reload',{
			 columns: [ 
				 { name: 'username',label: '入库人员', align: 'center',width: 100},
	        	 { name: 'hInfo',label: '硬件信息', align: 'center',width: 100},
	        	 { name: 'locType',label: '型号', align: 'center',width: 100},
	        	 { name: 'eNum',label: '入库数量', align: 'center',width: 100},
	        
	        	 { name: 'eDate',label: '入库时间', align: 'center',width: 150,render:'get_date'},
			        ],
			postData:{
				info:"{"+
					"\"username\":\""+name+"\","+
					
					"\"endDate\":\""+end+"\","+
					"\"startDate\":\""+start+	"\""+
					"}"
			}
		});
		}
	else{
		$('#sto_stor_record_id').datagrid('reload',{
			 columns: [ 
				 { name: 'username',label: '入库人员', align: 'center',width: 100},
	        	 { name: 'hInfo',label: '硬件信息', align: 'center',width: 100},
	        	 { name: 'locType',label: '型号', align: 'center',width: 100},
	        	 { name: 'eNum',label: '入库数量', align: 'center',width: 100},
	        
	        	 { name: 'eDate',label: '入库时间', align: 'center',width: 150,render:'get_date'},
	        	 
	        	 
			        ],
			postData:{
				info:"{"+
						"\"username\":\""+name+"\""+
					"}"
			}
		});
	
	}
	
}

</script>